package com.xframe.domain.e3sp.basedata;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description: 品种基础表
 * @ClassName: com.xframe.domain.e3sp.basedata.Variety
 * @Author: xufeng
 * @CreateTime: 2024/1/1
 **/
@Data
@Accessors(chain=true)
@XTable(value = "p_t02_variety", label = "品种")
@XSelectItem(keyName = "varietyId",codeName = "varietyCode",textName = "nameCn")
@XSelectItem(keyName = "varietyId",codeName = "varietyCode",textName = "nameEn",language = "en")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Series",foreignKey = "seriesId", targetKey = "seriesId",as = "refSeries")
public class Variety extends BaseModel {

    /**
     * 品种ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "variety_id", primaryKeyFlag = true,desc = "品种ID")
    private Long varietyId;

    /**
     * 车系ID
     */
    @XQueryCondition
    @XColumn(name = "series_id",desc = "车系ID")
    private Long seriesId;

    /**
     * 品种编码
     */
    @XQueryCondition
    @XGridTableRef
    @XColumn(name = "variety_code", uniqueFlag = true,desc = "品种编码",length = 200)
    private String varietyCode;

    /**
     * 中文名称
     */
    @XGridTableRef
    @XColumn(name = "name_cn",desc = "品种中文名称",length = 200)
    private String nameCn;

    /**
     * 英文名称
     */
    @XColumn(name = "name_en",desc = "品种英文名称",nullFlag = true,length = 200)
    private String nameEn;

    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",nullFlag = true,length = 500)
    private String remark;

    /**
     * 车系
     */
    private Series refSeries;
}
